package com.showtao.common.security.repository;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import com.showtao.common.security.domain.User;

public interface UserRepository extends JpaRepository<User, String> {

    User findByUserName(String userName);
    
    @Query("select distinct u from User u left join u.roles")
    Page<User> findAllLeftJoinRoles(Pageable pageable);
}
